package com.bm.server.service.impl;
import com.bm.common.dto.LotteryDto;
import com.bm.common.util.Rutils;
import com.bm.common.vo.R;
import com.bm.server.dao.LotteryDao;
import com.bm.server.service.intf.LotteryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LotteryServiceImpl implements LotteryService {
    @Resource
    private LotteryDao dao;
    @Override
    public R five(LotteryDto dto) {
        if(dto!=null){
            if(dto.getNum()>=500){
                return  Rutils.ok(dao.five()) ;
            }else{
                return Rutils.fail("没钱了亲");
          }
        }return Rutils.fail("参数错误");
      
    }

    @Override
    public R one(LotteryDto dto) {
        if(dto!=null){
            if(dto.getNum()>=500){
                return  Rutils.ok(dao.selectOne()) ;
            }else{
                return Rutils.fail("没钱了亲");
            }
        }return Rutils.fail("参数错误");

    }
    
}
       
    

